import ElementPlus from "element-plus"
import type { App } from "vue"
import zhCn from "element-plus/es/locale/lang/zh-cn"
import * as ElementPlusIconsVue from "@element-plus/icons-vue"
import { toLine } from "@/utils"
export function setupUI(app: App<Element>) {
  app.use(ElementPlus, { locale: zhCn })
}

export function setupIcons(app: App<Element>) {
  Object.keys(ElementPlusIconsVue).forEach((key) => {
    app.component(`el-icon-${toLine(key)}`, ElementPlusIconsVue[key as keyof typeof ElementPlusIconsVue])
  })
}
